package com.github.ecbp.user.service.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.github.ecbp.common.data.mapper.BaseMapper;
import com.github.ecbp.user.service.entity.TMenu;
import com.github.ecbp.user.service.entity.TRole;
import com.github.ecbp.user.service.entity.TRoleMenuRelation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 后台角色菜单关系表 Mapper 接口
 * </p>
 *
 * @author zj2626
 * @since 2020-03-18
 */
public interface RoleMenuRelationMapper extends BaseMapper<TRoleMenuRelation> {
    /**
     * 通过角色ID查询菜单信息
     *
     * @param wrapper
     * @return java.util.Set<com.ecbp.service.user.entity.TMenu>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TMenu> getMenuByRoleId(@Param(Constants.WRAPPER) Wrapper<TRoleMenuRelation> wrapper);

    /**
     * 通过菜单ID查询角色信息
     *
     * @param wrapper
     * @return java.util.Set<com.ecbp.service.user.entity.TRole>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TRole> getRoleByMenuId(@Param(Constants.WRAPPER) Wrapper<TRoleMenuRelation> wrapper);

}
